<?php


/**
 * Framework_Module_Welcome
 *
 * @author      Ian Szewczyk <roamzero@gmail.com>
 * @copyright   (c) 2007 Ian Szewczyk. All rights reserved.
 * @license     http://www.opensource.org/licenses/bsd-license.php
 * @package Module
 * @filesource
 */

/**
 * Framework_Module_Welcome
 *
 * @author Ian Szewczyk <roamzero@gmail.com>
 * @package Module
 */
class Framework_Module_Welcome extends Framework_Module
{
	public function __construct()
	{
		$this->controllers[] = 'Peopletab';
		$this->presenter = 'Smarty';
		$this->tplFile = 'Welcome.tpl';
		$this->pageTemplateFile = 'WelcomePage.tpl';
		parent::__construct();
	}

	public function __default()
	{
		$siteUserTable = Framework_DB::tableFactory('SiteUser');
		
		$queryArray = array(
			'sqlKey' => array(
				'select' => '*'
			)
		);
		
		$numberOfUsers = $siteUserTable->selectCount($queryArray);
		
		
		if (!$numberOfUsers) {
			$numberOfUsers = 0;
		}
		
		$this->setData('numberOfUsers', $numberOfUsers);
		
		$ownerTable = Framework_DB::tableFactory('Owner');
		
		$numberOfOwners = $ownerTable->selectCount($queryArray);
		
		if (!$numberOfOwners) {
			$numberOfOwners = 0;
		}
		
		$this->setData('numberOfOwners', $numberOfOwners);
		
	}

	

	public function __destruct()
	{
		parent::__destruct();
	}
}

?>
